<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Aloha Editor command outdent tests</title>
	<!-- include qunit -->
	<link rel="stylesheet" href="../vendor/qunit.css" type="text/css"/>

	<script type="text/javascript" src="../vendor/qunit.js"></script>

	<!-- include jquery -->
	<script	src="../../lib/vendor/jquery-1.7.2.js" ></script>
	<script type="text/javascript" src="../vendor/jquery.simulate.js"></script>

	<!-- include aloha -->
	<script>
		var Aloha = {
			settings: {
				jQuery: $,
				baseUrl: '../../lib'
			}
		};
	</script>
	<script src="../../lib/require.js"></script>
	<script src="../../lib/aloha.js" data-aloha-plugins="common/ui,common/list"></script>

	<!-- inject into testswarm -->
	<script type="text/javascript" src="../vendor/swarminject.js"></script>
	<script>
		// load command test suite
		require( ['commandtest'] );
	</script>
	<style type="text/css">
		.aloha-editable ol li { list-style-type: decimal; margin: 1.5em; }
		.aloha-editable ol li ol li{ list-style-type: decimal; margin: 2em; }
	</style>
</head>
<body>
	<!-- include the tests -->
	<script>
	var tests = {
		defaultCommand: 'outdent',
		tests: [
			{ start: '<ol><li>foo[]</li></ol>',
				execResult: '<ol><li>foo[]</li></ol>'
			},
			{	start: '<ol><li>foo<ul><li>[]bar</li></ul></li></ol>',
				execResult: '<ol><li>foo</li><li>[]bar</li></ol>'
			},
			{	exclude: ["msie7.0", "msie8.0"],
				start: '<ol><li>foo<ul><li>[]bar</li><li>baz</li></ul></li></ol>',
				execResult: '<ol><li>foo</li><li>[]bar<ul><li>baz</li></ul></li></ol>'
			},
			{	include: ["msie7.0", "msie8.0"],
				start: '<ol><li>foo<ul><li>[]bar</li><li>baz</li></ul></li></ol>',
				execResult: '<ol><li>foo</li><li>[]bar <ul><li>baz</li></ul></li></ol>'
			},
			{	exclude: ["msie7.0", "msie8.0"],
				start: '<ol><li>foo<ul><li>bar</li><li>baz[]</li></ul></li></ol>',
				execResult: '<ol><li>foo<ul><li>bar</li></ul></li><li>baz[]</li></ol>'
			},
			{	exclude: ["msie7.0", "msie8.0"],
				start: '<ol><li>foo<ol><li>bar<ol><li>b[]az</li></ol></li></ol></li></ol>',
				execResult: '<ol><li>foo<ol><li>bar</li><li>b[]az</li></ol></li></ol>'
			},
			{	include: ["msie7.0", "msie8.0"],
				start: '<ol><li>foo <ol><li>bar <ol><li>b[]az</li></ol></li></ol></li></ol>',
				execResult: '<ol><li>foo <ol><li>bar </li><li>b[]az</li></ol></li></ol>'
			},
			{	exclude: ["msie7.0", "msie8.0"],
				start: '<ol><li>foo<ol><li>b[]ar<ol><li>baz</li></ol></li></ol></li></ol>',
				execResult: '<ol><li>foo</li><li>b[]ar<ol><li>baz</li></ol></li></ol>'
			},
			{	include: ["msie7.0", "msie8.0"],
				start: '<ol><li>foo <ol><li>b[]ar <ol><li>baz</li></ol></li></ol></li></ol>',
				execResult: '<ol><li>foo </li><li>b[]ar <ol><li>baz</li></ol></li></ol>'
			},
			{	exclude: ["msie7.0", "msie8.0"],
				start: '<ol><li>[foo<ul><li>bar]</li></ul></li></ol>',
				execResult: '<ol><li>[foo<ul><li>bar]</li></ul></li></ol>'
			},
			{	include: ["msie7.0", "msie8.0"],
				start: '<ol><li>[foo<ul><li>bar]</li></ul></li></ol>',
				execResult: '<ol><li>[foo <ul><li>bar]</li></ul></li></ol>'
			},
			{	exclude: ["msie7.0", "msie8.0"],
				start: '<ol><li>foo<ul><li>[bar</li></ul></li><li>baz]</li></ol>',
				execResult: '<ol><li>foo</li><li>[bar</li></ol><p>baz]</p>'
			},
			{	include: ["msie7.0", "msie8.0"],
				start: '<ol><li>foo <ul><li>[bar</li></ul></li><li>baz]</li></ol>',
				execResult: '<ol><li>foo </li><li>[bar</li></ol><p>baz]</p>'
			},
			{	exclude: ["msie7.0", "msie8.0"],
				start: '<ol><li>foo<ul><li>ba[r</li><li>ba]z</li><li>quz</li></ul></li></ol>',
				execResult: '<ol><li>foo</li><li>bar</li><li>ba[]z<ul><li>quz</li></ul></li></ol>'
			},
			{	include: ["msie7.0", "msie8.0"],
				start: '<ol><li>foo <ul><li>ba[r</li><li>ba]z</li><li>quz</li></ul></li></ol>',
				execResult: '<ol><li>foo </li><li>bar</li><li>ba[]z <ul><li>quz</li></ul></li></ol>'
			},
			{	exclude: ["msie7.0", "msie8.0"],
				start: '<ol><li>foo<ul><li>bar</li><li>b[a]z</li><li>quz</li></ul></li></ol>',
				execResult: '<ol><li>foo<ul><li>bar</li></ul></li><li>b[a]z<ul><li>quz</li></ul></li></ol>'
			},
			{	include: ["msie7.0", "msie8.0"],
				start: '<ol><li>foo <ul><li>bar</li><li>b[a]z</li><li>quz</li></ul></li></ol>',
				execResult: '<ol><li>foo <ul><li>bar</li></ul></li><li>b[a]z <ul><li>quz</li></ul></li></ol>'
			},
			{	exclude: ["msie7.0", "msie8.0"],
				start: '<ol><li>foo<ul><li>bar</li><li>b[az</li><li>quz]</li></ul></li></ol>',
				execResult: '<ol><li>foo<ul><li>bar</li></ul></li><li>b[az</li><li>quz]</li></ol>'
			},
			{	exclude: ["msie7.0", "msie8.0"],
				start: '<ol><li>foo<ul><li>bar</li><li>baz</li><li>qu[z]</li></ul></li></ol>',
				execResult: '<ol><li>foo<ul><li>bar</li><li>baz</li></ul></li><li>qu[z]</li></ol>'
			}
		]
	}
	</script>
	<h1 id="qunit-header">Aloha Editor outdent tests</h1>
	<h2 id="qunit-banner"></h2>
	<div id="qunit-testrunner-toolbar"></div>
	<h2 id="qunit-userAgent"></h2>
	<ol id="qunit-tests"></ol>
	<div id="qunit-fixture"></div>
	<div id="edit" style="margin:20px; border:1px solid #000000;"></div>
	<div id="logBody"></div>
</body>
</html>
